﻿use persons
go
------------------5----------------------------------------------------------------
/*Find all mothers*/
SELECT DISTINCT 
[Person].[ID],
[Person].[FirstName], 
[Person].[LastName]
FROM [dbo].[Person], [dbo].[Person] AS [MOTHER] 
WHERE [Person].[ID]=[MOTHER].[fk_motherId]

SELECT DISTINCT 
[Person].[ID],
[Person].[FirstName], 
[Person].[LastName]
FROM [dbo].[Person] INNER JOIN [dbo].[Person] AS [MOTHER] 
ON [Person].[ID]=[MOTHER].[fk_motherId]

SELECT 
[Person].[ID],
[Person].[FirstName], 
[Person].[LastName]
FROM [dbo].[Person] WHERE [Person].[ID] IN (SELECT DISTINCT 
[Person].[fk_motherId] 
FROM [dbo].[Person])